package com.jiaoyou.baojian.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.jiaoyou.baojian.fragment.MainFragment;
import com.jiaoyou.baojian.fragment.RoomListFragment;
import com.jiaoyou.baojian.fragment.ShengyouTabFragment;
import com.jiaoyou.baojian.fragment.TabFragment;
import com.jiaoyou.baojian.fragment.TopFragment;

/**
 * Created by DemonZYM on 17/4/12.
 */

public class MainActivityPagerAdapter extends FragmentPagerAdapter {
    public MainActivityPagerAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int position) {
        switch(position){
            case 0:
//                return MainFragment.newInstance();
                return ShengyouTabFragment.newInstance();
            case 1:
//                return TopFragment.newInstance();
                return RoomListFragment.newInstance();
        }
        return TabFragment.newInstance(getPageTitle(position).toString());
    }

    @Override
    public int getCount() {
        return 2;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        switch (position) {
            case 0:
                return "声优";
            case 1:
                return "包房";
//            case 2:
//                return "我";
        }
        return null;
    }
}
